/*
	The directives starting with # below ensures that this file is read by the compiler only once
	even if it is #included several times. It is call an "include guard"
*/
#ifndef ORDER_H_
#define ORDER_H_

//other types
#include "Chrono.h"					
#include <string>
#include <sstream>
#include <iomanip>	//TNC B.2

using namespace std;
using namespace Chrono;

struct Order {
public:
	//data

	// constructors
	Order () {}
	Order(int oid, int sid, int tid, Date od, Time ot):
	order_id(oid), server_id(sid), table_id(tid), order_date(od), order_time(ot) {}
   
	// utility functions
	string display() const {	//modified by TNC B.2
		ostringstream oss;
		oss << setw(WIDTH) << left << order_id << setw(WIDTH) << left << server_id << setw(WIDTH) << left << table_id << setw(WIDTH) << left	//TNC B.2
			<< order_date.display() << setw(WIDTH) << left << order_time.display();	//TNC B.2
		return oss.str();
	}

	inline friend std::ostream& operator<< (std::ostream& os, Order const& oi) //Josh B.1
        { 
        return os << oi.order_id << " " << oi.server_id << " " << oi.table_id << " " << oi.order_date << " " << oi.order_time;
    }
	int get_table_id() const {return table_id;}	//B.2.a
	int get_order_id() const {return order_id;}	//B.2.a

	Date get_order_date() const {return order_date;} //TNC D

	static const int WIDTH = 13;	//TNC B.2
private:
   //constants

   // private data
	int order_id;
	int server_id;
	int table_id;
	Date order_date;
	Time order_time;
};


#endif //ORDER_H_